package com.recommend.persistence;

import com.recommend.domain.CommentDomain;
import com.recommend.dto.admin.Comment;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CommentDomainMapper {
    int deleteByPrimaryKey(Integer commentId);

    int insert(CommentDomain record);

    int insertSelective(CommentDomain record);

    CommentDomain selectByPrimaryKey(Integer commentId);

    int updateByPrimaryKeySelective(CommentDomain record);

    int updateByPrimaryKey(CommentDomain record);

    List<CommentDomain> selectAllGroupByMovie();

    @Select("select distinct movie_id from comment")
    List<Integer> selectAllMovie();

    List<Integer> getMovieSelective(Comment comment);

    List<Integer> getCustomerSelective(Comment comment);

    @Select("select DISTINCT customer_id from comment where movie_id = #{movieId} ")
    List<Integer> selectCustomerByMovie(int movieId);

    List<Comment> selectCommentByMovie(int movieId, int customerId);

    List<Comment> selectCommentSelective(CommentDomain commentDomain);
    
    @Select("select * from comment where movie_id = #{movieId} ")
    List<Comment> selectCommentByMovie(int movieId);
}